import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login'
import welcome from '@/components/welcome'
import NotFound from '@/components/NotFound'

import systemPub from '@/view/systemPub'
import imOrder from '@/view/imOrdering'
import transOrder from '@/view/transportOrder'
import infoDeta from '@/view/infoDetail'
import amendPsd from '@/view/amendPassword'


//用车管理
import orderList from '@/view/orderList'
import orderDetail from '@/view/orderDetail'
import orderCompileDetail from '@/view/orderCompileDetail'
import orderBill from '@/view/orderBill'
import billDetail from '@/view/billDetail'

import driverList from '@/view/driverList'

//代理管理
import organList from '@/view/agencyOrganList'
import organSet from '@/view/agencyOrganSet'
import agencyList from '@/view/agencyList'
import agencySet from '@/view/agencySet'



//系统管理
import systemList from '@/view/systemList'
import roleList from '@/view/roleList'
import limitsList from '@/view/limitsList'
import roleAllotDetail from '@/view/roleAllotDetail'
import roleAccessDetail from '@/view/roleAccessDetail'


Vue.use(Router);

const routes = [
  {
    path: '/login',
    component: Login,
    hidden: true
  },
  {
    path: '/',
    component: Login,
    hidden: true
  },
  {
    path: '/404',
    component: NotFound,
    name: '404',
    leaf: true,
    hidden: true
  },
  {
    name: "",
    path: "/",
    component: systemPub,
    iconCls: "",
    hidden: true,
    leaf: true,
    children: [
     
    ]
  },
  {
    name: "",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "首页",
        path: "welcome",
        component: welcome,
        iconCls: "el-icon-star-on",
        leaf: true,
      },

    ]
  },
  // {
  //   name: "用车管理",
  //   path: "/",
  //   component: systemPub,
  //   iconCls: "el-icon-star-on",
  //   hidden: false,
  //   leaf: true,
  //   children: [
  //     {
  //       name: "我要用车",
  //       path: "imorder",
  //       component: imOrder,
  //       iconCls: "el-icon-star-on",
  //       leaf: true,
  //     },{
  //       name: "用车订单",
  //       path: "transorder",
  //       component: transOrder,
  //       iconCls: "el-icon-star-on",
  //       leaf: true,
  //     },
      
      
  //   ]
  // },
  {
    name: "个人中心",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "个人信息",
        path: "infoDeta",
        component: infoDeta,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "修改密码",
        path: "amendPsd",
        component: amendPsd,
        iconCls: "el-icon-star-on",
        leaf: true,
      },
      
      
    ]
  },{
    name: "用车管理",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "订单列表",
        path: "orderList",
        component: orderList,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "订单详情",
        path: "orderDetail",
        component: orderDetail,
        iconCls: "el-icon-star-on",
        leaf: true,
        hidden: true,
      },{
        name: "订单编辑",
        path: "orderCompileDetail",
        component: orderCompileDetail,
        iconCls: "el-icon-star-on",
        leaf: true,
        hidden: true,
      },{
        name: "用车账单",
        path: "orderBill",
        component: orderBill,
        iconCls: "el-icon-star-on",
        leaf: true,
        hidden: true,
      },{
        name: "账单详情",
        path: "billDetail",
        component: billDetail,
        iconCls: "el-icon-star-on",
        leaf: true,
        hidden: true,
      },{
        name: "司机列表",
        path: "driverList",
        component: driverList,
        iconCls: "el-icon-star-on",
        leaf: true,
        hidden: true,
      }

    ]
  },{
    name: "代理管理",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "机构列表",
        path: "organList",
        component: organList,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "机构创建",
        path: "organSet",
        component: organSet,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "代理列表",
        path: "agencyList",
        component: agencyList,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "代理创建",
        path: "agencySet",
        component: agencySet,
        iconCls: "el-icon-star-on",
        leaf: true,
      },
      
      
    ]
  },{
    name: "系统管理",
    path: "/",
    component: systemPub,
    iconCls: "el-icon-star-on",
    hidden: false,
    leaf: true,
    children: [
      {
        name: "管理员列表",
        path: "systemList",
        component: systemList,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "管理员配角色",
        path: "roleAllotDetail",
        component: roleAllotDetail,
        iconCls: "el-xitong_access-star-on",
        hidden: true,
        leaf: true
      },{
        name: "角色列表",
        path: "roleList",
        component: roleList,
        iconCls: "el-icon-star-on",
        leaf: true,
      },{
        name: "角色权限配置",
        path: "roleAccessDetail",
        component: roleAccessDetail,
        iconCls: "el-xitong_access-star-on",
        hidden: true,
        leaf: true
      },{
        name: "权限列表",
        path: "limitsList",
        component: limitsList,
        iconCls: "el-icon-star-on",
        leaf: true,
      }
    ]
  },

]

const router = new Router({
  routes
});


export default router
